package com.sfj.system.mapper;

import com.sfj.system.entity.TaskReviewEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author kaka
 * @Date 2025/07/05
 */
@Mapper
public interface TaskReviewMapper {
    /**
     * 插入审批记录
     */
    @Options(useGeneratedKeys = true, keyProperty = "reviewId")
    int insert(TaskReviewEntity taskReviewEntity);

    /**
     * 更新审批记录
     */
    int update(TaskReviewEntity taskReviewEntity);

    /**
     * 根据任务ID查询审批记录
     */
    TaskReviewEntity selectByTaskId(@Param("taskId") Integer taskId);

    /**
     * 根据状态查询审批记录列表
     */
    List<TaskReviewEntity> selectByStatus(@Param("status") String status);

    /**
     * 删除审批记录
     */
    int delete(@Param("reviewId") Integer reviewId);
}
